
package com.craterhill.java.ems.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.craterhill.java.ems.common.beans.DateFormat;
import com.craterhill.java.ems.dao.utils.EMSResultSetExtractor;

public interface DateFormatDao extends EMSDao<DateFormat> {

	public final String FIELD_LIST = "obj.date_format_id, obj.date_format";

	public final String FIND_ALL = "select " + FIELD_LIST + " from date_format obj";

	public final class DateFormatExtractor extends EMSResultSetExtractor<DateFormat> {

		@Override
		protected DateFormat extractResultSetData(ResultSet resultSet) throws SQLException {
			DateFormat dateFormat = new DateFormat();
			dateFormat.setDateFormatId(resultSet.getInt(1));
			dateFormat.setDateFormat(resultSet.getString(2));
			return dateFormat;
		}
	}
}
